<!--
startVal	the value you want to begin at	Number	0
endVal	the value you want to arrive at	Number	2017
duration	duration in millisecond	Number	3000
autoplay	when mounted autoplay	Boolean	true
decimals	the number of decimal places to show	Number	0 decimals..
decimal	the split decimal	String	.
separator	the separator	String	,
prefix	the prefix	String	''
suffix	the suffix	String	''
useEasing	is use easing function	Boolean	true
easingFn	the easing function	Function	—
方法
start	start the countTo
pause	pause the countTo
reset	reset the countTo
-->
<template>
   <countTo :startVal='startVal' :endVal='endVal' :duration='duration' :separator='separator'></countTo>
</template>

<script>
import countTo from 'vue-count-to';
export default {
  components: { countTo },
  props: {
    duration: {
      type: Number,
      default() {
        return 3000;
      }
    },
    startVal: {
      type: Number,
      default() {
        return 0;
      }
    },
    endVal: {
      type: Number,
      default() {
        return 0;
      }
    },
    separator: {
      type: String,
      default() {
        return ',';
      }
    },
  },
  data() {
    return {
      // 需要滚动的时间
        // duration: 5000,
        // // 初始值
        // startVal: 0,
        // // 最终值
        // endVal: 2018
    }
  },
  mounted() {
  },
  beforeDestroy() {
 
  },
  watch: {
    'chartObj.data': {
        handler(val, old) {
         // alert(1);
           this.initChart();
        }
    }
  },
  methods: {
    initChart() {}
  }
}
</script>
<style scoped >
.myChart{
    width: 100%;
    height: 100%
}
</style>
